package com.java.bean;

import com.java.util.DateUtil;

import java.sql.Timestamp;
import java.util.Objects;

public class Express {
    private int id;
    private String number;
    private String company;
    private String username;
    private String userphone;
    private String sysphone;
    private String code;
    private int estatus;
    private Timestamp intime;
    private Timestamp outtime;

    public Express() {}

    public Express(String number, String company, String username, String userphone, String sysphone) {
        this.number = number;
        this.company = company;
        this.username = username;
        this.userphone = userphone;
        this.sysphone = sysphone;
    }

    public Express(int id, String number, String company, String username, String userphone, String sysphone, String code, int estatus, Timestamp intime, Timestamp outtime) {
        this.id = id;
        this.number = number;
        this.company = company;
        this.username = username;
        this.userphone = userphone;
        this.sysphone = sysphone;
        this.code = code;
        this.estatus = estatus;
        this.intime = intime;
        this.outtime = outtime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getEstatus() {
        return estatus;
    }

    public void setEstatus(int estatus) {
        this.estatus = estatus;
    }

    public Timestamp getIntime() {
        return intime;
    }

    public void setIntime(Timestamp intime) {
        this.intime = intime;
    }

    public Timestamp getOuttime() {
        return outtime;
    }

    public void setOuttime(Timestamp outtime) {
        this.outtime = outtime;
    }


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserphone() {
        return userphone;
    }

    public void setUserphone(String userphone) {
        this.userphone = userphone;
    }

    public String getSysphone() {
        return sysphone;
    }

    public void setSysphone(String sysphone) {
        this.sysphone = sysphone;
    }

    @Override
    public String toString() {
        return "Express{" +
                "id=" + id +
                ", number='" + number + '\'' +
                ", company='" + company + '\'' +
                ", username='" + username + '\'' +
                ", userphone='" + userphone + '\'' +
                ", sysphone='" + sysphone + '\'' +
                ", code='" + code + '\'' +
                ", estatus=" + estatus +
                ", intime=" + DateUtil.format(intime) +
                ", outtime=" + DateUtil.format(outtime) +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Express express = (Express) o;
        return id == express.id && estatus == express.estatus && Objects.equals(number, express.number) && Objects.equals(company, express.company) && Objects.equals(username, express.username) && Objects.equals(userphone, express.userphone) && Objects.equals(sysphone, express.sysphone) && Objects.equals(code, express.code) && Objects.equals(intime, express.intime) && Objects.equals(outtime, express.outtime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, number, company, username, userphone, sysphone, code, estatus, intime, outtime);
    }
}
